package org.aurora.core.biz.service.impl;

import org.apache.commons.collections4.CollectionUtils;
import org.aurora.core.biz.persistence.SlotAssignMapper;
import org.aurora.core.biz.service.ISlotAssignService;
import org.aurora.model.entity.SlotAssignInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SlotAssignServiceImpl implements ISlotAssignService {

    @Resource
    private SlotAssignMapper slotAssignMapper;

    @Override
    public void batchUpdateSlotAssignInfo(List<SlotAssignInfo> slotAssignInfos) {
        if (CollectionUtils.isEmpty(slotAssignInfos)) {
            return;
        }
        this.slotAssignMapper.batchUpdateSlotAssignInfo(slotAssignInfos);
    }

    @Override
    public SlotAssignInfo querySlotAssignInfoBySlot(int slot) {
        return this.slotAssignMapper.querySlotAssignInfoBySlot(slot);
    }
}
